﻿// Copyright 2005, 2006 - Morten Nielsen (www.iter.dk)
//
// This file is part of SharpMap.
// SharpMap is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// SharpMap is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.

// You should have received a copy of the GNU Lesser General Public License
// along with SharpMap; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 

using System;
using System.Runtime.Serialization;
//using System.Collections.Generic;
//using System.Text;

namespace Petra.Gis.ReferenceSystemServices
{
  /// <summary>
  /// The Info object defines the standard information
  /// stored with spatial reference objects
  /// </summary>
  [DataContract(Name="INFO")]
  public class Metadata
  {

    /// <summary>
    /// xaml constructor
    /// </summary>
    public Metadata() { }




    /// <summary>
    /// normal constructor for metadata applicable to coordinate system objects.
    /// </summary>
    /// <remarks>
    /// <para>The metadata items ‘Abbreviation’, ‘Alias’, ‘Authority’, ‘AuthorityCode’, ‘Name’ and ‘Remarks’ 
    /// were specified in the Simple Features interfaces, so they have been kept here.</para>
    /// <para>This specification does not dictate what the contents of these items 
    /// should be. However, the following guidelines are suggested:</para>
    /// <para>When <see cref="ICoordinateSystemAuthorityFactory"/> is used to create an object, the ‘Authority’
    /// and 'AuthorityCode' values should be set to the authority name of the factory object, and the authority 
    /// code supplied by the client, respectively. The other values may or may not be set. (If the authority is 
    /// EPSG, the implementer may consider using the corresponding metadata values in the EPSG tables.)</para>
    /// <para>When <see cref="CoordinateSystemFactory"/> creates an object, the 'Name' should be set to the value
    /// supplied by the client. All of the other metadata items should be left empty</para>
    /// </remarks>
    /// <param name="name">Name</param>
    /// <param name="authority">Authority name</param>
    /// <param name="code">Authority-specific identification code.</param>
    /// <param name="alias">Alias</param>
    /// <param name="abbreviation">Abbreviation</param>
    /// <param name="remarks">Provider-supplied remarks</param>
    public Metadata(
            string name,
            string authority,
            long code,
            string alias,
            string abbreviation,
            string remarks)
    {
      Name = name;
      Authority = authority;
      AuthorityCode = code;
      Alias = alias;
      Abbreviation = abbreviation;
      Remarks = remarks;
    }




    #region Metadata Members

    //protected string _Name;

    /// <summary>
    /// Gets or sets the name of the object.
    /// </summary>
    [DataMember(Name="NAME", Order=1)]
    public string Name
    { get; set; }




    //protected string _Authority;

    /// <summary>
    /// Gets or sets the authority name for this object, e.g., "EPSG",
    /// is this is a standard object with an authority specific
    /// identity code. Returns "CUSTOM" if this is a custom object.
    /// </summary>
    [DataMember(Name = "AUTHORITY", Order = 2)]
    public string Authority
    { get; set; }





    //protected long _Code;

    /// <summary>
    /// Gets or sets the authority specific identification code of the object
    /// </summary>
    [DataMember(Name = "CODE", Order = 3)]
    public long AuthorityCode
    { get; set; }





    //protected string _Alias;

    /// <summary>
    /// Gets or sets the alias of the object.
    /// </summary>
    [DataMember(Name = "ALIAS", Order = 4)]
    public string Alias
    { get; set; }

    
    
    
    
    //protected string _Abbreviation;

    /// <summary>
    /// Gets or sets the abbreviation of the object.
    /// </summary>
    [DataMember(Name = "ABBREV", Order = 5)]
    public string Abbreviation
    { get; set; }





    //protected string _Remarks;

    /// <summary>
    /// Gets or sets the provider-supplied remarks for the object.
    /// </summary>
    [DataMember(Name = "NOTE", Order = 6)]
    public string Remarks
    { get; set; }
 

    #endregion
  }
}
